import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

import 'ios_contact_permission_platform_interface.dart';

/// An implementation of [IosContactPermissionPlatform] that uses method channels.
class MethodChannelIosContactPermission extends IosContactPermissionPlatform {
  /// The method channel used to interact with the native platform.
  @visibleForTesting
  final methodChannel = const MethodChannel('ios_contact_permission');

  @override
  Future<int> getContactPermission() async {
    final status =
        await methodChannel.invokeMethod<int>('getContactPermission');
    return status!;
  }

  @override
  Future<bool> requestContactPermission() async {
    final status =
        await methodChannel.invokeMethod<bool>('requestContactPermission');
    return status!;
  }
}
